//
//  PKLoginView.m
//  PianKe
//
//  Created by ybq on 15/12/24.
//  Copyright © 2015年 B7_Young. All rights reserved.
//

#import "PKLoginView.h"

@implementation PKLoginView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self creatUI];
    }
    return self;
}

- (void)creatUI {
    _backButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _backButton.frame = CGRectMake(15, 10, 20, 20);
    [_backButton setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)];
    [self addSubview:_backButton];
    
    _registerButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _registerButton.frame = CGRectMake(kWidth - 50, 10, 40, 20);
    [_registerButton setTitle:@"注册" forState:(UIControlStateNormal)];
    _registerButton.titleLabel.font = [UIFont systemFontOfSize:16];
    [_registerButton setTitleColor:[UIColor lightGrayColor] forState:(UIControlStateNormal)];
    [self addSubview:_registerButton];
    
    _logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake((kWidth - 100) / 2, 75, 100, 50)];
    _logoImageView.image = [UIImage imageNamed:@"pianke"];
    [self addSubview:_logoImageView];
    
    _mailBox = [[PKLTView alloc] initWithFrame:CGRectMake(40, kHeight - 325, kWidth - 80, 40)];
    _mailBox.label.text = @"邮箱:";
    [self addSubview:_mailBox];
    
    _passWord = [[PKLTView alloc] initWithFrame:CGRectMake(40, kHeight - 265, kWidth - 80, 40)];
    _passWord.label.text = @"密码:";
    [self addSubview:_passWord];
    
    _loginButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _loginButton.frame = CGRectMake(40, kHeight - 210, kWidth - 80, 32);
    [_loginButton setTitle:@"登录" forState:(UIControlStateNormal)];
    _loginButton.titleLabel.font = [UIFont systemFontOfSize:15];
    _loginButton.backgroundColor = [UIColor colorWithRed:120 / 255.0 green:180 / 255.0 blue:70 / 255.0 alpha:1];
    [self addSubview:_loginButton];
    
    _leftLine = [[UIImageView alloc] initWithFrame:CGRectMake(40, kHeight -120, (kWidth - 160) / 2 - 5, .5)];
    _leftLine.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:_leftLine];
    
    _label = [[UILabel alloc] initWithFrame:CGRectMake((kWidth - 160) / 2 + 40, kHeight -130, 80, 20)];
    _label.text = @"合作伙伴登录片刻";
    _label.font = [UIFont systemFontOfSize:10];
    [self addSubview:_label];
    
    _rightLine = [[UIImageView alloc] initWithFrame:CGRectMake((kWidth - 160) / 2 + 125, kHeight -120, (kWidth - 160) / 2 - 5, .5)];
    _rightLine.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:_rightLine];
    
    _weiboButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _weiboButton.frame = CGRectMake(40, kHeight - 85, 25, 25);
    [_weiboButton setImage:[UIImage imageNamed:@"weibo"] forState:(UIControlStateNormal)];
    [self addSubview:_weiboButton];
    
    _renrenButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _renrenButton.frame = CGRectMake(kWidth / 2 - 60, kHeight - 85, 25, 25);
    [_renrenButton setImage:[UIImage imageNamed:@"renren"] forState:(UIControlStateNormal)];
    [self addSubview:_renrenButton];
    
    _doubanButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _doubanButton.frame = CGRectMake(kWidth / 2 + 35, kHeight - 85, 25, 25);
    [_doubanButton setImage:[UIImage imageNamed:@"douban"] forState:(UIControlStateNormal)];
    [self addSubview:_doubanButton];
    
    _qqButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _qqButton.frame = CGRectMake(kWidth - 70, kHeight - 85, 25, 25);
    [_qqButton setImage:[UIImage imageNamed:@"qq"] forState:(UIControlStateNormal)];
    [self addSubview:_qqButton];
    
    
}





@end
